package UPPM;

import java.util.List;
import java.util.ResourceBundle;
import java.util.concurrent.TimeUnit;

import junit.framework.Assert;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

import com.thoughtworks.selenium.webdriven.commands.Click;

import UPPM.Utils;

public class TestLicensing {
	
	WebDriver driver = new FirefoxDriver();
	
	@Before
	public void setUp() throws Exception {
		driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
		driver.manage().window().maximize();
		driver.get("http://test.unippmtest.co.uk");		
		}

	
	@Test
	public void testLicensing() throws Exception {
		Utils.Login(driver);
//		Thread.sleep(1000);
		driver.findElement(By.xpath(".//*[@id='header-links']/ul/li[5]/a")).click();;
//		Assert.assertEquals("Licensing", licensing.getText().trim());
//		licensing.click();
		Thread.sleep(1000);
		WebElement name = driver.findElement(By.xpath(".//*[@id='pageRows']/div/div[1]/div/div[2]/div/div[2]/div/div[1]/div/h2"));
		Assert.assertEquals("Licensing Music from Universal Publishing Production Music", name.getText().trim());
		driver.findElement(By.xpath(".//*[@id='pageRows']/div/div[1]/div/div[2]/div/div[2]/div/div[2]/table/tbody/tr[6]/td[2]/a")).click();
		
	}		
	
	@After
	public void tearDown() throws Exception {
		System.out.println("******************************");
		driver.quit();
	}
	
}
